<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title></title>
    <meta name="description" content="Restyling jQuery UI Widgets and Elements" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
    <link type="text/css" rel="stylesheet" href="../css/bootstrap.css">
    <script type="text/javascript" src="../js/bootstrap-paginator.js"></script>
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/font-awesome.min.css" />
    <link rel="stylesheet" href="../css/ace-fonts.css" />
    <link rel="stylesheet" href="../css/ace.min.css" id="main-ace-style" />
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="../css/ace-part2.min.css" />
    <![endif]-->
    <!--[if lte IE 9]>
    <link rel="stylesheet" href="../css/ace-ie.min.css" />
    <![endif]-->
    <script src="../js/ace-extra.min.js"></script>
    <!--[if lte IE 8]>
    <script src="../js/html5shiv.min.js"></script>
    <script src="../js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .CSSearchTbl{ border:1px #008CD4 solid;}
        .CSSearchTbl thead{}
        .CSSearchTbl thead tr{}
        .CSSearchTbl thead tr th{  text-align:left; padding-left:10px;}
        .CSSearchTbl tbody{}
        .CSSearchTbl tbody tr{}
        .CSSearchTbl tbody tr td{  padding: 10px;}
        .CSSearchTbl tbody tr td.right{ text-align: left;}
        .CSSearchTbl tbody tr td.left{ text-align: right;}
        .table-responsive{ display: none;}
    </style>
    <script src="../js/jquery-1.9.1.min.js"></script>
    <script>

        $(document).ready(function(){
          $.ajax({
              url:"http://121.40.216.49:50031/api/apply/getList",
              data:{
                 'page_num':1,
                  'page_size':10,
                  'apply_type':1,
              },
              type:'post',
              dataType:'json',
              success:function(data){
                  var html = "";
                  $.each(data.data.list,function(i,item){
                      var apply_type = item.apply_type;
                      if(apply_type==1){
                          html+="<tr>";
                          html+="<td>免费试用</td>";
                          html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                          html+="<td>"+item.name+"</td>";
                          html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                          html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                          html+="<td>"+item.create_time+"</td>";
                          html+="</tr>";
                      }else{
                          html+="<tr>";
                          html+="<td>企业申请 </td>";
                          html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                          html+="<td>"+item.name+"</td>";
                          html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                          html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                          html+="<td>"+item.create_time+"</td>";
                          html+="</tr>";
                      }
                  });
                  var allpage = data.data.totalRow;
                  var pageNumber = data.data.pageNumber;
                  var totalPage = data.data.totalPage;
                  $("#resultList").html(html);
                  $("#allpage").text(allpage);
                  $("#pageNumber").text(pageNumber);
                  $("#pagenum").val(pageNumber);
                  $("#pigNumbers").val(totalPage);
                  $("#totalPage").text(totalPage);
              },
          });
        });


  function before() {
     var pagenum = $("#pagenum").val();
    if (pagenum == 1){
     alert("已是第一页！！");
    }else{
        var page_num = pagenum-1;
        $.ajax({
            url:"http://121.40.216.49:50031/api/apply/getList",
            data:{
                'page_num':page_num,
                'page_size':10,
                'apply_type':1,
            },
            type:'post',
            dataType:'json',
            success:function(data){
                var html = "";
                $.each(data.data.list,function(i,item){
                    var apply_type = item.apply_type;
                    if(apply_type=1){
                        html+="<tr>";
                        html+="<td>免费试用</td>";

                        html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                        html+="<td>"+item.name+"</td>";
                        html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                        html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                        html+="<td>"+item.create_time+"</td>";
                        html+="</tr>";
                    }else{
                        html+="<tr>";
                        html+="<td>企业申请 </td>";

                        html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                        html+="<td>"+item.name+"</td>";
                        html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                        html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                        html+="<td>"+item.create_time+"</td>";
                        html+="</tr>";
                    }
                });
                var allpage = data.data.totalRow;
                var pageNumber = data.data.pageNumber;
                var totalPage = data.data.totalPage;
                $("#resultList").html(html);
                $("#allpage").text(allpage);
                $("#pageNumber").text(pageNumber);
                $("#pagenum").val(pageNumber);
                $("#totalPage").text(totalPage);
                $("#bigNum").val(totalPage);
            },
        });

    }
  }

        function after() {
            var pagenum = $("#pagenum").val();
           var page_num=++pagenum;
           var bigNum = $("#pigNumbers").val();
            if (page_num>bigNum){
                alert("已是最后一页")
            }else{
                var page_num = pagenum+0;
                $.ajax({
                    url:"http://121.40.216.49:50031/api/apply/getList",
                    data:{
                        'page_num':page_num,
                        'page_size':10,
                        'apply_type':1,
                    },
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        var html = "";
                        $.each(data.data.list,function(i,item){
                            var apply_type = item.apply_type;
                            if(apply_type=1){
                                html+="<tr>";
                                html+="<td>免费试用</td>";

                                html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                                html+="<td>"+item.name+"</td>";
                                html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                                html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                                html+="<td>"+item.create_time+"</td>";
                                html+="</tr>";
                            }else{
                                html+="<tr>";
                                html+="<td>企业申请 </td>";

                                html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                                html+="<td>"+item.name+"</td>";
                                html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                                html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                                html+="<td>"+item.create_time+"</td>";
                                html+="</tr>";
                            }

                        });
                        var allpage = data.data.totalRow;
                        var pageNumber = data.data.pageNumber;
                        var totalPage = data.data.totalPage;
                        $("#resultList").html(html);
                        $("#allpage").text(allpage);
                        $("#pageNumber").text(pageNumber);
                        $("#pagenum").val(pageNumber);
                        $("#totalPage").text(totalPage);
                        $("#bigNum").val(totalPage);
                    },
                });
            }
        }



        function searchPage() {
           var apply_type = $("#apply_type").val();
           var platform_id=$("#platform_id").val();
      if(apply_type == "" && platform_id==""){

      }
      else if(apply_type !== "" && platform_id ==""){
                $.ajax({
                    url:"http://121.40.216.49:50031/api/apply/getList",
                    data:{
                        'page_num':1,
                        'page_size':10,
                        'apply_type':apply_type,
                    },
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        var html = "";
                        $.each(data.data.list,function(i,item){
                            var apply_type = item.apply_type;
                            if(apply_type==1){
                                html+="<tr>";
                                html+="<td>免费试用</td>";

                                html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                                html+="<td>"+item.name+"</td>";
                                html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                                html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                                html+="<td>"+item.create_time+"</td>";
                                html+="</tr>";
                            }else{
                                html+="<tr>";
                                html+="<td>企业申请</td>";

                                html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                                html+="<td>"+item.name+"</td>";
                                html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                                html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                                html+="<td>"+item.create_time+"</td>";
                                html+="</tr>";
                            }
                        });
                        var allpage = data.data.totalRow;
                        var pageNumber = data.data.pageNumber;
                        var totalPage = data.data.totalPage;
                        $("#resultList").html(html);
                        $("#allpage").text(allpage);
                        $("#pageNumber").text(pageNumber);
                        $("#pagenum").val(pageNumber);
                        $("#pigNumbers").val(totalPage);
                        $("#totalPage").text(totalPage);
                    },
                });
            }
      else if(apply_type == "" && platform_id !==""){
          $.ajax({
              url:"http://121.40.216.49:50031/api/apply/getList",
              data:{
                  'page_num':1,
                  'page_size':10,
                  'platform_id':platform_id,
              },
              type:'post',
              dataType:'json',
              success:function(data){
                  var html = "";
                  $.each(data.data.list,function(i,item){
                      var apply_type = item.apply_type;
                      if(apply_type==1){
                          html+="<tr>";
                          html+="<td>免费试用</td>";

                          html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                          html+="<td>"+item.name+"</td>";
                          html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                          html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                          html+="<td>"+item.create_time+"</td>";
                          html+="</tr>";
                      }else{
                          html+="<tr>";
                          html+="<td>企业申请</td>";

                          html+="<td class=\"hidden-480\">"+item.mobile+"</td>";
                          html+="<td>"+item.name+"</td>";
                          html+="<td class=\"hidden-480\">"+item.company_name+"</td>";
                          html+="<td class=\"hidden-480\">" +item.remarks+"</td>";
                          html+="<td>"+item.create_time+"</td>";
                          html+="</tr>";
                      }
                  });
                  var allpage = data.data.totalRow;
                  var pageNumber = data.data.pageNumber;
                  var totalPage = data.data.totalPage;
                  $("#resultList").html(html);
                  $("#allpage").text(allpage);
                  $("#pageNumber").text(pageNumber);
                  $("#pagenum").val(pageNumber);
                  $("#pigNumbers").val(totalPage);
                  $("#totalPage").text(totalPage);
              },
          });
      }
        }
    </script>
</head>

<body class="no-skin">
<div class="main-container" id="main-container">
    <div class="main-content">
        <div class="row">
            <div class="col-xs-6">
                <tr>
                    <td>申请类型：</td>
                    <td colspan="3">
                        <select name="" id="apply_type">
                            <option value="">选择</option>
                                <option value="1">免费试用</option>
                             <option value="2">企业申请</option>
                        </select>
                    </td>

                    <td>运营商类型：</td>
                    <td colspan="3">
                        <select name="" id="platform_id">
                            <option value="">选择</option>
                            <option value="1">微码</option>
                            <option value="17">同真</option>
                        </select>
                    </td>
                </tr>
            </div>
            <div class="">
                <div id="example_filter">
                    <label>
                        <button type="button" class="btn btn-primary" onclick="searchPage();">查询</button>
                    </label>
                </div>
            </div>
        </div>

        <div class="page-content">
            <!-- /section:settings.box -->
            <div class="page-content-area">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <div class="col-xs-12">
                                <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>申请类型</th>

                                        <th class="hidden-480">电话</th>
                                        <th>姓名</th>
                                        <th>公司</th>
                                        <th class="hidden-480">
                                            <i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>
                                            备注</th>
                                        <th>创建时间</th>

                                    </tr>
                                    </thead>

                                    <tbody id="resultList">

                                    </tbody>
                                </table>


  <TR>

<DIV  style="LINE-HEIGHT: 20px; HEIGHT: 20px; TEXT-ALIGN: right" >
	共[<B id="allpage"></B>]条记录,共[<B id="totalPage"></B>]页,当前第[<b id="pageNumber"></b>]页
    <input type="hidden" id="pagenum" name="pageNumber" value="">
    <input type="hidden" id="pigNumbers" name="cxb" value="">
    <!--
        当前页-1
        判断如果第一页，没有前一页
        如果最后一页，没有后一页
     -->
	[<A href="javascript:before();">前一页</A>]
    <!--
        当前页+1
     -->
	[<A href="javascript:after();">后一页</A>]
</DIV>
            </TR>
                  </div><!-- /.span -->
                        </div><!-- /.row -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content-area -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->


    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
</div>

<script src="../js/bootstrap.min.js"></script>

<script src="../js/jquery.dataTables.min.js"></script>
<script src="../js/jquery.dataTables.bootstrap.js"></script>

<!-- ace scripts -->
<script src="../js/ace-elements.min.js"></script>
<script src="../js/ace.min.js"></script>
</body>
</html>